#ifndef __XMODEM_H
#define __XMODEM_H

#include "sys.h"

typedef struct
{
    uint8_t disk;
    uint32_t addr;
    char name[16];
    uint32_t length;
    uint32_t seek;
}XMODEM_FILE;

typedef  uint8_t (*xmodem_cb)(XMODEM_FILE* file, uint8_t *data, uint16_t datalen);

extern void xmodem_init(void *dev);
extern int xmodem_receive(XMODEM_FILE* file, xmodem_cb callback);
extern int xmodem_transmit(XMODEM_FILE* file, xmodem_cb callback);

#endif
